/**
 * Created by machan on 2017/4/2.
 */
import * as constants from '../common/Constants.js';

export function show(message, callBack, showCancel=false) {
    wx.showModal({
        title: '提示',
        content: message,
        showCancel: showCancel,
        cancelColor: "#000000",

        confirmColor: constants.Values.THEME_COLOR,
        success: function(res) {
            if (res.confirm) {
                callBack && callBack()
            }
        }
    });
}

export function showAll(message, cancelText, okText, okCB, cancelCB, outTapCB) {
    wx.showModal({
        title: '提示',
        content: message,
        showCancel: true,
        cancelText: cancelText,
        cancelColor: "#000000",

        confirmText: okText,
        confirmColor: constants.Values.THEME_COLOR,
        success: (ress)=> {
            if (ress.confirm) {
                okCB && okCB();
            } else if (ress.cancel) {
                cancelCB && cancelCB();
            } else {
                outTapCB && outTapCB();
            }
        },
    });
}